﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace SmartPlant.Model.DbContext
{
    [SugarTable("ITEMATTRIBUTIONS")]
    public class Itemattributions
    {
        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)]
        public decimal Id { get; set; }

        /// <summary>
        /// 这里的itemid，不一定是<see cref="Uniqueatts.Entity"/>对应的<see cref="Item.Id"/>。
        /// 比如ADD_SPEC【1001】，但是在这个表里itemid=1001为空，只有1071
        ///</summary>
        [SugarColumn(ColumnName = "ITEMID")]
        public decimal? Itemid { get; set; }

        /// <summary>
        /// 对应<see cref="Uniqueatts.Id"/>
        ///</summary>
        [SugarColumn(ColumnName = "ATTRIBUTIONID")]
        public decimal? Attributionid { get; set; }



        /// <summary>
        /// 需要关系跳转。里面的每一段，大于0都是<see cref="Relationships.RelNumber"/>，小于0都是绝对值<see cref="Filteredrelationship.Id"/>
        ///</summary>
        [SugarColumn(ColumnName = "PATH")]
        public string Path { get; set; }










        #region 1


        /// <summary>
        /// <see cref="Itemattributions.Attributionid"/>对应的<see cref="Uniqueatts"/>
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Uniqueatts Attribution { get; set; }

        /// <summary>
        /// 已經判斷了是rel，或者是小于0的filteredrel跳轉的rel
        /// </summary>
        public List<Relationships> Relationshipses = new List<Relationships>();

        #endregion 1
    }
}
